package me.helllp.dake.generator.engine;

import freemarker.template.TemplateException;
import lombok.Getter;
import lombok.Setter;
import me.helllp.dake.generator.config.GeneratorEngineConfiguration;
import me.helllp.dake.generator.config.ProjectConfiguration;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

public abstract class AbstractGenerator {
    /**
     * 引擎的整体规则配置
     */
    @Getter
    private GeneratorEngineConfiguration engineConfiguration;

    /**
     * 初始化代码生成器
     */
    public void initGenerator(GeneratorEngineConfiguration engineConfiguration) throws TemplateException, IOException, InvocationTargetException, IllegalAccessException {
        this.engineConfiguration = engineConfiguration;
    }

    /**
     * 代码生成主逻辑
     */
    public abstract void generator() throws IOException, TemplateException, InvocationTargetException, IllegalAccessException;
}
